import { http } from '@/utils/http.js'

/**
 * 获取所有的科室
 */
export const getDepAllAPI = () => {
	return http.get('/dep/all')
}

/**
 * 问诊-支付页面-计算就诊信息和抵扣信息
 */
export const getPreOrderAPI = (type, options = {}) => {
	return http.get('/patient/consult/order/pre', {
		params: {
			type,
			...options
		}
	})
}


/**
 * 生成预支付订单
 */
// export const createPreOrderAPI = (data) => {
// 	return http.post('/patient/consult/order', data)
// } 

/**
 * 生成待支付订单
 */
export const createPreOrderAPI = (data) => {
  return http.post('/patient/consult/order', data)
}

/**
 * 支付接口
 */
export const payAPI = (data) => {
	return http.post('/patient/consult/pay', data)
}


/**
 * 问诊订单详情
 */
export const orderDetailAPI = (orderId) => {
  return http.get('/patient/consult/order/detail', { params: { orderId } })
}